package com.chenggcode.simple.spi;

import com.chenggcode.simple.spi.service.DataService;

import java.util.ServiceLoader;

/**
 * @author Chenggcode
 * @date 2025/7/2 16:38
 */
public class Main {
    public static void main(String[] args) {
        // SPI加载实现类
        ServiceLoader<DataService> loader = ServiceLoader.load(DataService.class);

        for (DataService service : loader) {
            System.out.println(service.getData("exampleKey"));
        }
    }
}
